package com.springcloud.server.server.impl;

import com.springcloud.api.entries.Dept;
import com.springcloud.server.mapper.DeptMapper;
import com.springcloud.server.server.DeptServer;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author tiansongtao
 * @date 2019年04月11日-17时16分
 */
@Service
public class DeptServerImpl implements DeptServer {

    @Autowired
    private DeptMapper deptMapper;

    public boolean addDept(Dept dept) {
        System.out.println(dept.toString());
        return deptMapper.insertDept(dept);
    }

    public Dept getById(Long deptno) {
        return deptMapper.selectDeptById(deptno);
    }

    public List<Dept> getAllDept() {
        return deptMapper.selectAllDept();
    }
}
